<?php

namespace origin;

/**
 * 错误异常类
 * @explain 抛出错误和异常
 * @author  dece <decezz@qq.com>
 */
class Exception extends \Exception
{
    /**
     * 构造
     */
    public function __construct( $info , $code )
    {
        parent::__construct($info, intval($code));
    }

    /**
     * 错误信息
     */
  	public function error ()
    {
    	return [
    		'info' => $this->message,
    		'code' => $this->code,
    		'file' => $this->file,
    		'line' => $this->line,
    	];
    }
}